Skip to content

Conversation

dferre97
Copy link
Contributor

@dferre97 dferre97 commented Aug 6, 2025

Added a coalesce method and an is_coalesced flag to keep track of whether a COO graph is coalesced, which means:

  • there are no duplicated coordinates in the indices (i.e, no multi-edges)
  • the source and target indices are ordered lexicographically (by source, then by target)

Some operations (e.g., sparse matrix multiplication in forward pass) could be implemented more efficiently if a COO graph is coalesced.

@CarloLucibello
Copy link
Member

can you test that operations like add_edges returning a new graph set coalesce to false?
Also we should add an expose an is_coalesced(g) method just returning g.is_coalesced.

@CarloLucibello CarloLucibello merged commit a0a7fad into JuliaGraphs:master Aug 25, 2025
5 of 7 checks passed
@dferre97 dferre97 deleted the df/coo-coalesce_graph branch August 26, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants